﻿using Google.Protobuf.WellKnownTypes;
using Microsoft.AspNetCore.Builder;
using Prometheus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ebusiness_Framework.ResourcesMonitoring
{
    public static class ResourcesMoniterApplicationBuilderExtentions
    {
        /// <summary>
        /// 集成资源监控
        /// </summary>
        /// <returns></returns>
        public static IApplicationBuilder UseResourcesMoniter(this IApplicationBuilder applicationBuilder) 
        {
            // 3、集成prometheus-net.AspNetCore
            applicationBuilder.UseMetricServer(); // 集成  
            applicationBuilder.UseHttpMetrics();//访问监控的数据。
            return applicationBuilder;
        }
    }
}
